home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 March: Reference Library / Dev.CD Mar 97 RL.toast / mac / Technical Documentation / develop / develop Issue 27 / develop Issue 27 code / Internet Config Assistant / toolkit / TAssistant.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-30  |  2.6 KB  |  105 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        TAssistant.h
  3.  
  4.     Contains:    Base class implementing an assistant
  5.  
  6.     Written by:    Arno Gourdol
  7.  
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12. #pragma once
  13.  
  14. #ifndef __TASSISTANT__
  15. #define __TASSISTANT__
  16.  
  17. #include "CMultiDialogs.h"
  18. #include "TApplication.h"
  19.  
  20. enum
  21. {
  22.     kQuitConfirmationDialog = 129,
  23.     kMaxPane = 100        // Maximum number of panes in an interview
  24. };
  25.  
  26. class TAssistant : public CMultiDialog
  27. {
  28. public:
  29.     enum 
  30.     {
  31.         kCommonPane = 200,
  32.         kConclusionPane = 209,
  33.         kDetailsPane = 210,
  34.         
  35.         kContinueButton = 1,
  36.         kGoBackButton = 2,
  37.         kPaneNumber = 3,
  38.         kBannerBackground = 4,
  39.         kNavbarBackground = 5,
  40.         kHelpCommonItem = 6,
  41.         kLastCommonItem = 6,
  42.  
  43.         kGoAheadButton = kLastCommonItem + 1,
  44.         kCancelButton = kLastCommonItem + 2,
  45.         kShowDetailsButton = kLastCommonItem + 3,
  46.         kHideDetailsButton = kLastCommonItem + 3
  47.     };
  48.     
  49.     // constructor
  50.     TAssistant(SInt16 firstPane, 
  51.                 SInt16 lastPane, 
  52.                 TApplication* application = NULL);
  53.         
  54.     // destructor
  55.     virtual ~TAssistant();        
  56.     
  57.     // events
  58.     virtual void DrawUserItem(TDrawContext& graphics, 
  59.                                 short item, 
  60.                                 const CRect& frame);
  61.     void DrawBanner(TDrawContext& graphics, const CRect& frame);
  62.     void DrawNavigationBar(TDrawContext& graphics, const CRect& frame);
  63.     virtual void ItemHit(UInt16 pane, short item);
  64.     virtual void GoToNextPane(void);
  65.     virtual void GoToPreviousPane(void);
  66.     virtual void GoToPane(UInt16 paneID);
  67.     virtual Boolean FilterKey(const EventRecord& event, UInt16 key);
  68.     
  69.     // dialog managment
  70.     virtual void PrepareDialog(void);
  71.     
  72.     virtual Boolean CloseRequested(void);
  73.     virtual void Close(void);
  74.     
  75.     // interview
  76.     virtual SInt16 NextPane(SInt16 currentPane);    // Given the current pane, 
  77.                                             // returns next pane    
  78.     virtual Boolean SkipPane(SInt16 pane);    // Return true if pane should be skipped,
  79.                                     // false if the pane should be displayed
  80.     
  81.     virtual void GoAhead(void);        // Function called when the
  82.                                     //     user clicks the to go ahead button
  83.                                     // in the conclusion pane
  84.  
  85. protected:
  86.     // Returns the next available pane after currentPane
  87.     SInt16 FindNextPane(SInt16 currentPane);
  88.     
  89. private:
  90.     TApplication* fApplication;        // If this is a stand-alone assistant,
  91.                                     // application in which it is running
  92.     SInt16 fFirstPane;                // ResourceID of the first pane
  93.     SInt16 fLastPane;                // ResourceID of the last pane
  94.  
  95.     Boolean fShowDetails;            // True if showing details at the 
  96.                                     //     conclusion pane
  97.     Str255 fPaneTitle;                // Title of the current pane
  98.  
  99.     SInt16 fHistory[kMaxPane];        // Stack of visited panes ID
  100.     UInt16 fHistoryIndex;            // Current stack pointer in the history
  101.                                     // fHistory[fHistoryIndex] is the current pane
  102. };
  103.  
  104. #endif
  105.